package com.management.demo.common.enums;

/**
 * 异常枚举
 * 定义异常错误码为 5位数字
 * 前两位为业务场景 后三位为错误码
 * 10:通用
 * 001:参数校验失败
 */
public enum ExceptionEnum {

    UNKNOWN_EXCEPTION(10000, "系统未知异常"),
    VALID_EXCEPTION(10001, "参数格式验证失败");

    private final int code;

    private final String msg;

    ExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
